<template>
    <x-table></x-table>
</template>
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onBeforeMount, onMounted, onBeforeUnmount, onUnmounted } from "vue";
import XTable from "@/components/XTable/index.vue";
//定义一个变量
const myName = ref("萧大侠");
//定义一个数据集
const formData = reactive({
  name: "",
  region: "",
});
onBeforeMount(() => {
  console.log("组件挂载前");
});
onMounted(() => {
  initData();
  console.log("组件挂载完成");
});
onBeforeUnmount(() => {
  console.log("组件卸载之前");
});
onUnmounted(() => {
  console.log("组件卸载完成");
});
const initData = () => {
  console.log(myName, formData);
};
const handleNew = (index: number) => {
  console.log("handleNew");
};
const handleEdit = (index: number) => {
  console.log("handleEdit");
};
const handleDelete = (index: number) => {
  console.log("handleDelete");
};
const onSubmit = () => {
  console.log("submit!");
};
</script>